//
// C++ Implementation: mainwindow
//
// Description: 
//
//
// Author: javier,,, <javier@javier-laptop>, (C) 2006
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "mainwindow.h"

mainWindow::mainWindow(QWidget *parent)
  : QMainWindow(parent)
{
  ui.setupUi(this);

  QObject::connect(ui.tankList, SIGNAL(externalTankSelect( int, eLT, int )), this, SIGNAL(externalTankSelect( int, eLT, int )));
  QObject::connect(ui.eventList, SIGNAL(eventSelected( int )), this, SIGNAL(eventSelected( int )));
  QObject::connect(ui.actionA_brir, SIGNAL(activated()),this,SIGNAL(abrir()));
  QObject::connect(ui.action_salir, SIGNAL(activated()),this,SIGNAL(salir()));
  
  ui.actionDetector->setChecked(true);
  ui.actionReferencias->setChecked(false);
  QObject::connect(ui.actionDetector, SIGNAL(toggled(bool)),this,SIGNAL(showDet(bool)));
  QObject::connect(ui.actionReferencias, SIGNAL(toggled(bool)),this,SIGNAL(showRef(bool)));
  QObject::connect(ui.actionInfo, SIGNAL(toggled(bool)),this,SIGNAL(showInf(bool)));
}


mainWindow::~mainWindow()
{
}

void mainWindow::setTankList( vector<tCandidate> *statList )
{
  ui.tankList->setTankList( statList );
}

void mainWindow::tankSelect( int sId)
{
  ui.tankList->tankSelect( sId );
  tankListPointer=ui.tankList;
}

void mainWindow::setEventsList( vector< tEventsummary > *eventList)
{
  ui.eventList->setEventsList( eventList );
}

void mainWindow::setValue( pmtTrace *trace )
{
  ui.traces->setValue( trace );
}

void mainWindow::showDetButton(bool checked)
{
  ui.actionDetector->setChecked(checked);
}

void mainWindow::showRefButton(bool checked)
{
  ui.actionReferencias->setChecked(checked);
}

void mainWindow::showInfButton(bool checked)
{
  ui.actionInfo->setChecked(checked);
}
